# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=gcolor3
pkgver=2.4.0
pkgrel=5
pkgdesc='Simple color chooser written in GTK'
arch=('loong64' 'x86_64')
url='https://www.hjdskes.nl/projects/gcolor3/'
license=('GPL2')
depends=('at-spi2-core' 'cairo' 'gdk-pixbuf2' 'glib2' 'gtk3' 'hicolor-icon-theme')
makedepends=('appstream-glib' 'meson')
source=("https://gitlab.gnome.org/World/$pkgname/-/archive/v$pkgver/$pkgname-v$pkgver.tar.gz"
        'portal.patch')
sha256sums=('d6071390a0980fb8eb8418750766c744cf0bca56f24ab4dbe3f23cb1ffd1973d'
            '8dcb21d421eef8d0bc95c62fee860a82fe5d8ae90a5c8d93b8e62444bf9c1152')

prepare() {
  cd $pkgname-v$pkgver
  # Revert Wayland support, keep Xorg supported for now
  # https://gitlab.gnome.org/World/gcolor3/-/issues/124
  patch -RNp1 -i ../portal.patch
}

build() {
  arch-meson $pkgname-v$pkgver build -D werror=false
  meson compile -C build
}

check() {
  meson test -C build
}

package() {
  meson install -C build --destdir "$pkgdir"
}
